package com.asset.dispoal.business.approval.service;

import com.asset.dispoal.business.approval.api.RepaymentApproverService;
import com.asset.dispoal.business.approval.dto.ApproverListResponse;
import com.asset.dispoal.business.approval.dto.AuditRequest;
import com.asset.dispoal.business.approval.dto.GetApproverRequest;
import com.asset.dispoal.business.approval.dto.GetRepaymentApprovalListRequest;
import com.asset.dispoal.business.approval.dto.RepaymentApprovalResponse;
import com.asset.dispoal.business.approval.dto.RepaymentApproverBindRequest;
import com.asset.dispoal.business.approval.dto.RepaymentApproverResponse;
import com.asset.dispoal.business.approval.dto.RepaymentDetailResponse;
import com.asset.dispoal.business.approval.service.command.AuditCommand;
import com.asset.dispoal.business.approval.service.command.BindReapymentApproverCommand;
import com.asset.dispoal.business.approval.service.command.GetApprovalListCommand;
import com.asset.dispoal.business.approval.service.command.GetApprovalListDetailCommand;
import com.asset.dispoal.business.approval.service.command.GetApproverListCommand;
import com.asset.dispoal.business.approval.service.command.GetBindApproverCommand;
import com.asset.dispoal.business.approval.service.command.GetMyRepaymentListCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

/**
 * @description:
 * @author: yf
 * @date: 2022-10-09 10:07:07
 */
@Service
public class RepaymentApprovalServiceImpl implements RepaymentApproverService {
    @Autowired
    private BindReapymentApproverCommand bindReapymentApproverCommand;
    @Autowired
    private GetBindApproverCommand getBindApproverCommand;
    @Autowired
    private AuditCommand auditCommand;
    @Autowired
    private GetApprovalListCommand getApprovalListCommand;
    @Autowired
    private GetApprovalListDetailCommand getApprovalListDetailCommand;
    @Autowired
    private GetApproverListCommand getApproverListCommand;
    @Autowired
    private GetMyRepaymentListCommand getMyRepaymentListCommand;

    @Override
    public Result bind(RepaymentApproverBindRequest request) {
        return bindReapymentApproverCommand.execute(request);
    }

    @Override
    public Result<RepaymentApproverResponse> getBindApprover(String assetInstBatchId) {
        return getBindApproverCommand.execute(assetInstBatchId);
    }

    @Override
    public Result audit(AuditRequest request) {
        return auditCommand.execute(request);
    }

    @Override
    public Result<PageVO<RepaymentApprovalResponse>> getApprovalList(GetRepaymentApprovalListRequest request) {
        return getApprovalListCommand.execute(request);
    }

    @Override
    public RepaymentDetailResponse getApprovalDetail(String repaymentLogId) {
        return getApprovalListDetailCommand.execute(repaymentLogId);
    }

    @Override
    public Result<PageVO<ApproverListResponse>> getApprover(GetApproverRequest request) {
        return getApproverListCommand.execute(request);
    }

    @Override
    public Result<PageVO<RepaymentApprovalResponse>> getMyRepaymentList(GetRepaymentApprovalListRequest request) {
        return getMyRepaymentListCommand.execute(request);
    }
}
